1. Field of the Invention
The present invention relates to image processing method and apparatus which improve a distribution of brightness.
2. Related Background Art
Conventionally, as a method of taking a photograph of appropriate brightness, a method of measuring average luminance of a scene to be taken or photographed and then controlling shutter speed, an aperture value, and the like, based on the measured average luminance, is known. Moreover, an exposure control method based on so-called evaluation photometry that a scene is first divided into predetermined areas, the luminance of each of the divided areas is measured, the measured luminance is appropriately weighted with respect to each area, the average luminance is then obtained based on the weighted values, and the appropriate exposure is thus obtained with respect to the entire scene is known.
Incidentally, in a scene taken into the light (also called a backlight scene) such that the brightness of a main subject is remarkably dark as compared with that of its background, the main subject portion on a taken or photographed image is inevitably dark. Therefore, to take a photograph in which the appropriate brightness can be secured even in case of a backlight scene, it is necessary at the moment of taking the photograph to preset the exposure of a camera so that the subject is taken brightly as compared with a case of taking an average photograph. However, such an exposure correction operation is troublesome for a user, and moreover skill is required to appropriately set the exposure of the camera. Besides, even if the exposure correction operation is appropriately performed with respect to the main subject, the background portion of the main subject adversely tends to become bright excessively.
In order to solve such a problem, it is necessary to obtain an image of appropriate brightness even in the backlight scene or the like in which it is generally difficult to appropriately determine the brightness of the image.
Thus, to achieve this, in analog photographing technique, printing of appropriate brightness can be obtained by performing so-called a dodging process in a darkroom. Therefore, it is desirable even in a digital image process to easily achieve a dodging process similar to that in the analog photographing technique.
For example, a method of achieving the dodging process is proposed by Daniel J. Jobson et al. in “A Multiscale Retinex for Bridging the Gap Between Color Images and the Human Observation of Scenes”, IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 6, NO. 7, JULY 1997 (hereinafter called a prior art 1). In this method, a difference process between a component obtained by logarithmic transforming a digital image and a low-frequency component of the logarithmic-transformed component is performed to darken a bright component and brighten a dark component in a low-frequency area in the digital image, thereby achieving image improvement.
Besides, another method of achieving the dodging process in the digital image process is proposed by Reinhard et al. in “Photographic Tone Reproduction for Digital Images”, acm Transactions on Graphics, JULY 2002, Vol. 21, No. 3 (hereinafter called a prior art 2). In this method, a dodging-like effect is obtained in the digital image process by using a luminance component of a digital image and a low-frequency component thereof.
Moreover, Japanese Patent Application Laid-Open No. 08-110603 (hereinafter called a prior art 3) proposes a method of inferring an illumination light distribution based on position information and lightness information of a face area and then performing color adjustment according to the inferred illumination light distribution.
However, in such conventional methods, a degree of improvement in a case where large improvement is necessary with respect to the brightness of the main subject in the digital image to be processed is the same as that in a case where a little improvement is necessary with respect to the brightness of the main subject. Therefore, particularly in the case where the little improvement is necessary, the brightness distribution of the image is changed more than is necessary, and the contrast and the saturation of the image are thus excessively enhanced, whereby a satisfactory image cannot be obtained and noise in the image becomes noticeable.
Besides, as described above, the prior art 3 proposes one method of improving a brightness distribution based on the brightness of the face area. However, in this method, because a lightness distribution is obtained from the position information of the face area and the lightness information of each area, a problem occurs in a case where the image in question includes only one face area. In other words, it is described in the prior art 3 that the barycenter of the face area or the barycenter of the face area and other several points of the face area is used as the position information of the face area. However, when the barycenter of the face area is used as the position information of the face area, it is very difficult to correctly infer the illumination right distribution of the entire image from one point of one area. Moreover, it is doubtful whether the image which has been color-adjusted according to some inference result is preferable. In addition, even when the barycenter of the face area and other several points of the face area are used as the position information of the face area, it is also doubtful whether the image which has been color-adjusted by inferring the lightness distribution of the entire image from the lightness distribution of one face area is preferable.